package com.lfz.demo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lfz.demo.entity.ChinaPopulation;
import com.lfz.demo.entity.PopulationNews;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;

import java.util.List;

/**
 * @author lfz
 * @date 2025/3/5 18:16
 */
@Mapper
public interface PopulationNewsMapper extends BaseMapper<PopulationNews> {

    @Select("select * from population_news order by create_time desc limit 3")
//  @Select("SELECT id,title,content,create_time AS createTime,pubulishby FROM population_news ORDER BY create_time DESC limit 3")
    List<PopulationNews> listNewsLimit3();

    @Select("select * from population_news order by create_time desc")
    List<PopulationNews> pastNewsListDesc();
}
